package oj;

import java.util.Scanner;

public class Day12S {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int num=sc.nextInt();
            int n1=0;
            int n2=0;

            int min=Integer.MAX_VALUE;
            for (int i = num; i >0 ; i--) {
                int num1=i;
                int num2=num-i;
                if(isPrime(num1) && isPrime(num2)){
                    if(Math.abs(num1-num2)<min){
                        min=Math.abs(num1-num2);
                        n1=num1;
                        n2=num2;
                    }
                }
            }
            System.out.println(n2+"\n"+n1);

        }
    }

    private static boolean isPrime(int num) {
        for (int i = 2; i <=Math.sqrt(num); i++) {
            if(num%i==0){
                return false;
            }
        }
        return true;
    }
}
